﻿<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title>自动计算</title>
    <link href="../../../Scripts/easyUI145/themes/default/easyui.css" rel="stylesheet" />
    <script type="text/javascript" src="../../../Scripts/bootstrap/js/jquery.min.js"></script>
    <script src="../../../Scripts/QueryString.js" type="text/javascript"></script>
    <link href="../../../../DataUser/Style/ccbpm.css" rel="stylesheet" type="text/css" />
    <script type="text/javascript" src="../../../Scripts/bootstrap/js/jquery.min.js"></script>

    <!-- 引用通用的js文件. -->
    <script type="text/javascript" src="../../../Scripts/config.js"></script>
    <script type="text/javascript" src="../../../Comm/Gener.js"></script>
    <script src="../../Admin.js"></script>
    <script type="text/javascript" language="javascript">
        var fk_MapData = GetQueryString("FK_MapData");
        var keyOfEn = GetQueryString("KeyOfEn");

        //页面启动函数.
        $(function () {

            $("#Msg").html("");
            var handler = new HttpHandler("BP.WF.HttpHandler.WF_Admin_FoolFormDesigner_MapExt");
            handler.AddPara("FK_MapData", GetQueryString("FK_MapData"));
            handler.AddPara("KeyOfEn", GetQueryString("KeyOfEn"));
            var data = handler.DoMethodReturnString("LoadRDTClo_Init");

            if (data.indexOf('err@') == 0) {
                $("#Msg").html("<font color=red>加载失败:<br>" + data + "</font> .");
                return;
            }
            //转json.
            data = JSON.parse(data);

            //绑定查询.
            GenerBindDDL("DDL_StarRDT", data, "No", "Name");
            GenerBindDDL("DDL_EndRDT", data, "No", "Name");
            //加载已配置的数据
            var mypk = "ReqDays_" + fk_MapData + "_" + keyOfEn;
            var en = new Entity("BP.Sys.MapExt");
            en.SetPKVal(mypk);
            if (en.RetrieveFromDBSources() == 1) {
                $("#DDL_StarRDT option[value='" + en.Tag1 + "']").attr("selected", "selected");
                $("#DDL_EndRDT option[value='" + en.Tag2 + "']").attr("selected", "selected");
                $("input:radio[value=" + en.Tag3 + "]").attr('checked', 'true');
            }

            $("#Msg").html("");
            return;
        });
        function Save() {

            var handler = new HttpHandler("BP.WF.HttpHandler.WF_Admin_FoolFormDesigner_MapExt");
            handler.AddPara("FK_MapData", GetQueryString("FK_MapData"));
            handler.AddPara("KeyOfEn", GetQueryString("KeyOfEn"));
            handler.AddPara("DDL_StarRDT", $("#DDL_StarRDT").val());
            handler.AddPara("DDL_EndRDT", $("#DDL_EndRDT").val());
            handler.AddPara("RDTRadio", $("input[type='radio']:checked").val());
            var data = handler.DoMethodReturnString("LoadRDTClo_Save");
            alert(data);
        }
    </script>
</head>
<body>
    <form id="cc">
        <div style="right:10px; position:absolute; z-index:100; top:-3px">
            
            <input type="button" value="保存" onclick="Save()" id="Btn_Save" />
        </div>
        <table id="table" style="width: 100%;">
            <caption>
                自动计算日期天数
            </caption>
            <tr>
                <td colspan="3" style="width: 95%;">
                    选择开始日期:<select id="DDL_StarRDT" name="DDL_StarRDT"></select>
                    选择结束日期:<select id="DDL_EndRDT" name="DDL_EndRDT"></select>
                </td>
            </tr>
            <tr>
                <td colspan="3" style="width: 95%;">
                    <label><input type="radio" value="0" name="RDTRadio" />包含节假日</label>
                    <label><input type="radio" value="1" name="RDTRadio" />不包含节假日</label>

                </td>
            </tr>
        </table>


        <div id="Msg">
        </div>


    </form>
</body>
</html>
